function createXMLHttpRequest() {
	try {
		return new XMLHttpRequest();
	} catch (e) {
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alter("浏览器不兼容！");
				throw e;
			}
		}
	}
}
/*
 * method: 请求方式（默认GET）; url: 请求url; asyn: 是否异步（默认true）; params: 请求体; callback:
 * 回调方法; type: 响应类型（默认text）;
 */
function ajax(option) {
	var xmlHttp = createXMLHttpRequest();
	if (!option.method) {
		option.method = "GET";
	}
	if (option.asyn == undefined) {
		option.asyn = true;
	}
	xmlHttp.open(option.method, option.url, option.asyn);
	if ("POST" == option.method || "post" == option.method) {
		xmlHttp.setRequestHeader("Content-Type",
				"application/x-www-form-urlencoded");
	}
	xmlHttp.send(option.params);
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			var data;
			if (!option.type) {
				option.type = "text";
			}
			if (option.type == "xml") {
				data = xmlHttp.responseXML;
			} else if (option.type == "text") {
				data = xmlHttp.responseText;
			} else if (option.type == "json") {
				data = xmlHttp.responseText;
				data = eval("(" + data + ")");
			}
			option.callback(data);
		}
	};
}